package com.cgy.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import util.PoiHandler;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name="consumeLogs")
public class ConsumeLogs {

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@PoiHandler(excelHeader = "编号")
	private Integer lid;
	@Column(name = "l_card_id",unique = true)
	@PoiHandler(excelHeader = "学号/工号")
	private String lCardId;//卡号
	@Column(name = "l_in_time",unique = true)
	@PoiHandler(excelHeader = "进入时间")
	private String lInTime;//进入时间
	@Column(name = "l_out_time",unique = true)
	@PoiHandler(excelHeader = "离开时间")
	private String lOutTime;//离开时间
	@PoiHandler(excelHeader = "状态")
	@Column(name = "l_status",unique = true)
	private Integer lStatus;//用于统计（状态
	@ManyToOne(fetch=FetchType.EAGER)
	@PoiHandler(excelHeader = "资源室")
	@JoinColumn(name="zid")
	private ZiYuan ziYuan;  
	@PoiHandler(excelHeader = "电脑信息")
	@OneToOne(fetch=FetchType.EAGER)
	@JoinColumn(name = "cid") 
	private Computer computer;
}
